package cn.just.student_mall.util;

import org.springframework.stereotype.Controller;

/**
 * @Author wujiaming
 * @Description 封装响应结果的对象
 * @Date 2021-03-24 15:27
 * @Version 1.0
 */
public class JsonResult<T> {
    /**
     * 状态 2000表示成功
     */
    private Integer state;

    /**
     * 错误信息
     */
    private String message;

    /**
     * 数据
     */
    private T data;

    public JsonResult() {
    }

      public JsonResult(String message) {
        this.message = message;
    }

    public JsonResult(Integer state) {
        this.state = state;
    }

    public JsonResult(Integer state, String message) {
        this.state = state;
        this.message = message;
    }

    public JsonResult(Integer state, T data) {
        this.state = state;
        this.data = data;
    }

    public Integer getState() {
        return state;
    }

    public void setState(Integer state) {
        this.state = state;
    }

    public void setMessage(String message) {
        this.message = message;
    }

    public T getData() {
        return data;
    }

    public void setData(T data) {
        this.data = data;
    }
}
